package com.ruicar.afs.cloud.common.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.modules.contract.enums.VoucherStatusEnum;
import com.ruicar.afs.cloud.common.modules.enums.BusinessType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author infinity
 * @version 1.0
 * @date 2020/8/18 18:55
 */
@Data
public class VoucherFlowInfoVo {

    private static final long serialVersionUID = 1L;
    @ApiModelProperty("唯一标识")
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    @JSONField(
            serializeUsing = com.alibaba.fastjson.serializer.ToStringSerializer.class
    )
    @TableId(
            value = "id",
            type = IdType.ASSIGN_ID
    )
    private Long id;
    @ApiModelProperty("业务交易流水号")
    @NotBlank(message = "业务交易流水号不能为空")
    private String transNo;

    @ApiModelProperty("埋点编号")
    @NotBlank(message = "埋点编号不能为空")
    private String buriedPointNo;

    /** 合同号 */
    @ApiModelProperty("合同号")
    private String contractNo;

    /** 交易状态 枚举值：待发送，成功，失败 */
    @ApiModelProperty("交易状态 枚举值：未创建，已创建，待发送，成功，失败")
    @NotNull(message = "交易状态不能为空")
    private VoucherStatusEnum status;

    /** 品牌 */
    @ApiModelProperty("车辆品牌")
    private String carBrand;
    /** 金融产品 */
    @ApiModelProperty("金融产品")
    private String financialProducts;
    /** 部门 */
    @ApiModelProperty("部门")
    private String department;
    /** 供应商名称 */
    @ApiModelProperty("供应商名称")
    @NotBlank(message = "供应商名称不能为空")
    private String dealerName;

    @ApiModelProperty("业务类型 枚举值")
    private BusinessType businessType;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty("记账日期")
    private Date keepAccountDate;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty("日切时间")
    private Date dailyCutTime;

}
